<div class="admin">
    <div class="tab panel dux-box admin-panel">
        <div class="panel-head"><strong>广告管理</strong></div>
        <div class="padding border-bottom">
            <a href="JavaScript:void(0);" class="button button-small border-green">管理位</a>
            <a href="{:U('add')}" class="button button-small border-green">新增广告位</a>
        </div>
        <div class="fixed-empty"></div>
        <table class="table tb-type2">
            <thead>
                <tr class="thead">
                    <th><input type="checkbox" class="checkall"></th>
                    <th>名称</th>
                    <th class="align-center">类别</th>
                    <th class="align-center">展示方式</th>
                    <th class="align-center">宽度/字数</th>
                    <th class="align-center">高度</th>
                    <th class="align-center">正在展示</th>
                    <th class="align-center">已发布</th>
                    <th class="align-center">是否启用</th>
                    <th class="align-center">操作</th>
                </tr>
            </thead>
            <tbody>
            <form action="{:U('Adv/del')}" method="post" id="advform">
                <foreach item='v' name='list'>
                    <tr class="hover" style="background: rgb(255, 255, 255);">
                        <td class="w24"><input type="checkbox" class="checkitem" name="ap_id[]" value="{$v['ap_id']}"></td>
                        <td><span title="{$v['ap_name']}">{$v['ap_name']}</span></td>
                        <td class="align-center">
                            <switch name="v.ap_class">
                    <case value="0">图片</case>
                    <case value="1">文字</case>
                    <case value="2">幻灯</case>
                    <case value="3">Flash</case>
                    </switch>
                    </td>
                    <td class="align-center">
                        <switch name="v.ap_display">
                    <case value="0">幻灯片</case>
                    <case value="1">多广告展示</case>
                    <case value="2">单广告展示</case>
                    </switch>
                    </td>
                    <td class="align-center">{$v['ap_width']}</td>
                    <td class="align-center">{$v['ap_height']}</td>
                    <td class="align-center">0</td>
                    <td class="align-center">1</td>
                    <td class="align-center yes-onoff">
                        {$v['is_use']?启用:未启用}
                    </td>
                    <td class="align-center">
                        <a class="bg-yellow button button-little" href="{:U('adv',array('ap_id'=>$v['ap_id']))}"><i calss="icon-magic"></i>管理广告</a>
                        <a class="button bg-blue button-little" href="{:U('edit',array('ap_id'=>$v['ap_id']))}"><i class="icon-edit"></i>编辑</a>
                        <a class="button bg-red button-little" href="javascript:void(0)" onclick="copyToClipBoard('1047');"><i calss="icon-file-code-o"></i>代码调用</a>
                    </td>
                    </tr>
                </foreach>
            </form>
            </tbody>
            <tfoot>
                <tr class="tfoot">
                    <td><input type="checkbox" class="checkall" id="checkall"></td>
                    <td id="batchAction" colspan="15"><span class="all_checkbox">
                            <label for="checkall">全选</label>
                        </span>&nbsp;&nbsp;<a href="JavaScript:void(0);" class="button bg-main" onclick="if (confirm('您确定要删除所选广告位的所有信息吗')) {
                                    $('#advform').submit();
                                }"><span>删除</span></a>
                        <div class="pagination"><div class="pages clearfix">{$pages}</div></div>
                </tr>
            </tfoot>
        </table>

    </div>
</div>
<script type="text/javascript">
    $('#advform').layer({
        actionUrl: "batchAction",
        deleteUrl: "del",
    });
</script>